﻿using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Runtime.InteropServices.WindowsRuntime;
using Windows.Foundation;
using Windows.Foundation.Collections;
using Windows.UI;
using Windows.UI.Xaml;
using Windows.UI.Xaml.Controls;
using Windows.UI.Xaml.Controls.Primitives;
using Windows.UI.Xaml.Data;
using Windows.UI.Xaml.Input;
using Windows.UI.Xaml.Media;
using Windows.UI.Xaml.Navigation;

// https://go.microsoft.com/fwlink/?LinkId=234238 上介绍了“空白页”项模板

namespace XiaoweiUWP.Pags
{
    /// <summary>
    /// 可用于自身或导航至 Frame 内部的空白页。
    /// </summary>
    public sealed partial class WelcomePage : Page
    {
        public WelcomePage()
        {
            this.InitializeComponent();
        }

        private void scanBtn_PointerPressed(object sender, PointerRoutedEventArgs e)
        {

            this.scanBtn.Background = new SolidColorBrush(Color.FromArgb(255, 49, 135, 234));
           
        }

        private void scanBtn_PointerExited(object sender, PointerRoutedEventArgs e)
        {
           
            this.scanBtn.Background = new SolidColorBrush(Color.FromArgb(255, 80, 165, 251));
        }

        private void scanBtn_PointerEntered(object sender, PointerRoutedEventArgs e)
        {
            this.scanBtn.Background = new SolidColorBrush(Color.FromArgb(255, 103, 179, 255));
        }

        private void scanBtn_PointerReleased(object sender, PointerRoutedEventArgs e)
        {
            if (chproto.IsChecked == null || chproto.IsChecked ==false)
            {
                lginfo.Visibility = Visibility.Visible;
                return;
            }

            this.Frame.Navigate(typeof(ScanPage));
            //Frame frame= Window.Current.Content as Frame;

            //if(frame!=null)
            //{
            //    Frame.Navigate(typeof(ScanPage));
            //}

            // RootPage.RootFrame.Navigate(typeof(ScanPage));

        }
    }
}
